{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "aa0d7cb0-3c79-4a09-be10-af6be815c0c0",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pubchem_api\n",
    "from pubchem_api import pubchem_api"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "266ba36a-9765-42a2-968a-1e6fa81b727a",
   "metadata": {},
   "source": [
    "##### This API has 6 parameters:\n",
    "&emsp;&emsp;**·the base_url:** the base url of the PubChem REST API call   \n",
    "&emsp;&emsp;**·the compound_cid_selector:** pubchem基于CID运行调用的指令   \n",
    "&emsp;&emsp;**·the search_id** 从PubChem中提取的分子的化合物cid     \n",
    "&emsp;&emsp;**·the property** 向PubChem指示将请求物理化学性质   \n",
    "&emsp;&emsp;**·the output_property** 用于检索化学性质的PubChem的标识符   \n",
    "&emsp;&emsp;**·the output_format** 标识符用于PubChem以给定格式返回数据  \n",
    "(第一个参数是不能更改的)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "196969f2-ad35-4709-9a94-fb6e267b7ad8",
   "metadata": {
    "jupyter": {
     "source_hidden": true
    },
    "tags": []
   },
   "outputs": [],
   "source": [
    "# example 1:从单分子里提取单个特征\n",
    "base_url = \"https://pubchem.ncbi.nlm.nih.gov/rest/pug/\"\n",
    "compound_cid_selector = \"compound/cid/\"\n",
    "search_id = \"6322/\" # compound cid for molecule in question[6322对应的是Arg]\n",
    "property_1 = \"property/\"\n",
    "output_property = \"MolecularWeight/\" # indicates that we will retrieve the molecular weight for compound 6322\n",
    "output_format = \"CSV\" # output format from the REST API call\n",
    "output_file_name = \"test_data\" # output data will be saved as 'test_data.csv'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "bf20b35c-1887-4d70-86da-32e45f618c9d",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "# example 2:从多个分子里面提取多个特征\n",
    "base_url = \"https://pubchem.ncbi.nlm.nih.gov/rest/pug\"\n",
    "compound_cid_selector = \"compound/cid/\"\n",
    "cid_list = [\"6322\", \"5962\", \"5960\",\"33032\", \"5961\", \"6267\", \"6274\", \"5951\", \"6288\", \"5862\", \"6305\",\n",
    "            \"6057\", \"6137\", \"5950\", \"6306\", \"6106\", \"6140\", \"6287\", \"614\", \"750\"] # list of molecules to retrieve simultanesouly\n",
    "search_id = ','.join(cid_list) # concatenation of molecule cid's\n",
    "search_id = search_id+'/'\n",
    "property_1 = \"property/\"\n",
    "'''\n",
    "        [\"MolecularWeight\", \"XLogP\", \"TPSA\", \"Complexity\", \"HBondDonorCount\", \"HBondAcceptorCount\",\n",
    "             \"RotatableBondCount\", \"HeavyAtomCount\", \"AtomStereoCount\", \"DefinedAtomStereoCount\", \"Volume3D\", \"XStericQuadrupole3D\",\n",
    "             \"YStericQuadrupole3D\", \"ZStericQuadrupole3D\", \"FeatureCount3D\", \"FeatureAcceptorCount3D\", \"FeatureDonorCount3D\",\n",
    "             \"FeatureAnionCount3D\", \"FeatureCationCount3D\", \"FeatureRingCount3D\", \"FeatureHydrophobeCount3D\", \"ConformerModelRMSD3D\",\n",
    "             \"EffectiveRotorCount3D\", \"ConformerCount3D\"]\n",
    "amino_acid_cid = [\"6322\", \"5962\", \"5960\",\"33032\", \"5961\", \"6267\", \"6274\", \"5951\", \"6288\", \"5862\", \"6305\",\n",
    "                  \"6057\", \"6137\", \"5950\", \"6306\", \"6106\", \"6140\", \"6287\", \"614\", \"750\"]\n",
    "'''\n",
    "property_list = [\"MolecularWeight\", \"XLogP\", \"TPSA\", \"Complexity\", \"HBondDonorCount\", \"HBondAcceptorCount\",\n",
    "             \"RotatableBondCount\", \"HeavyAtomCount\", \"AtomStereoCount\", \"DefinedAtomStereoCount\", \"Volume3D\", \"XStericQuadrupole3D\",\n",
    "             \"YStericQuadrupole3D\", \"ZStericQuadrupole3D\", \"FeatureCount3D\", \"FeatureAcceptorCount3D\", \"FeatureDonorCount3D\",\n",
    "             \"FeatureAnionCount3D\", \"FeatureCationCount3D\", \"FeatureRingCount3D\", \"FeatureHydrophobeCount3D\", \"ConformerModelRMSD3D\",\n",
    "             \"EffectiveRotorCount3D\", \"ConformerCount3D\"] # list of properties to retrieve for all molecules given above\n",
    "output_property = ','.join(property_list)+\"/\" # indicates that we will retrieve all of the above chemical properties for all compounds\n",
    "output_format = \"CSV\" # output format from the REST API call\n",
    "output_file_name = \"test_data\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "58995c92-f7e4-4b7d-9211-f3f985c0b590",
   "metadata": {},
   "outputs": [],
   "source": [
    "base = \"https://pubchem.ncbi.nlm.nih.gov/rest/pug/\"\n",
    "input_1 = \"compound/cid/\"\n",
    "input_2 = \"property/\"\n",
    "output_format = \"CSV\"\n",
    "\n",
    "input_dic = [\"MolecularWeight\", \"XLogP\", \"TPSA\", \"Complexity\", \"HBondDonorCount\", \"HBondAcceptorCount\",\n",
    "             \"RotatableBondCount\", \"HeavyAtomCount\", \"AtomStereoCount\", \"DefinedAtomStereoCount\", \"Volume3D\", \"XStericQuadrupole3D\",\n",
    "             \"YStericQuadrupole3D\", \"ZStericQuadrupole3D\", \"FeatureCount3D\", \"FeatureAcceptorCount3D\", \"FeatureDonorCount3D\",\n",
    "             \"FeatureAnionCount3D\", \"FeatureCationCount3D\", \"FeatureRingCount3D\", \"FeatureHydrophobeCount3D\", \"ConformerModelRMSD3D\",\n",
    "             \"EffectiveRotorCount3D\", \"ConformerCount3D\"]\n",
    "\n",
    "amino_acid_cid = [\"6322\", \"5962\", \"5960\",\"33032\", \"5961\", \"6267\", \"6274\", \"5951\", \"6288\", \"5862\", \"6305\",\n",
    "                  \"6057\", \"6137\", \"5950\", \"6306\", \"6106\", \"6140\", \"6287\", \"614\", \"750\"]\n",
    "\n",
    "dic_amino_acids = {\n",
    "    \"arginine\":\"6322\", \"lysine\":\"5962\", \"aspartic acid\":\"5960\",\"glutamic acid\":\"33032\",\n",
    "    \"glutamine\":\"5961\", \"asparagine\":\"6267\", \"histidine\":\"6274\", \"serine\":\"5951\", \"threonine\":\"6288\",\n",
    "    \"cysteine\":\"5862\", \"tryptophan\":\"6305\", \"tyrosine\":\"6057\", \"methionine\":\"6137\", \"alanine\":\"5950\",\n",
    "    \"isoleucine\":\"6306\", \"leucine\":\"6106\", \"phenylalanine\":\"6140\", \"valine\":\"6287\", \"proline\":\"614\",\n",
    "    \"glycine\":\"750\"\n",
    "}\n",
    "i = ','.join(amino_acid_cid)+\"/\"\n",
    "j = ','.join(input_dic)+\"/\"\n",
    "output_format = 'CSV'"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "58b84047-8b99-4662-8f9a-a0493f782631",
   "metadata": {},
   "source": [
    "**我不能理解，为什么呀！！！！！**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "5429e5e5-97d0-499d-ab24-22227890a640",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The HTTP status code for this request is: 200.\n"
     ]
    }
   ],
   "source": [
    "amino_acid_data = pubchem_api.ApiGetFeatures(base, input_1, i, input_2, j, output_format,'test_data')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "5df60e70-a485-44b6-a991-2d79b074935b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The HTTP status code for this request is: 200.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<pubchem_api.pubchem_api.ApiGetFeatures at 0x211965314f0>"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# pubchem_api.ApiGetFeatures(base_url, \n",
    "#                            compound_cid_selector, \n",
    "#                            search_id, \n",
    "#                            property_1, \n",
    "#                            output_property, \n",
    "#                            output_format, \n",
    "#                            output_file_name)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4ed99f3d-78f7-44cd-a40c-10f28fa0e332",
   "metadata": {},
   "source": [
    "#### 添加首行氨基酸的名字(最好是单字缩写)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "1f8e847f-d5eb-49cb-bb3b-0eef1ce79d95",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "658af1ff-cd6e-4267-aa72-e7c36e29f9f1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CID</th>\n",
       "      <th>MolecularWeight</th>\n",
       "      <th>XLogP</th>\n",
       "      <th>TPSA</th>\n",
       "      <th>Complexity</th>\n",
       "      <th>HBondDonorCount</th>\n",
       "      <th>HBondAcceptorCount</th>\n",
       "      <th>RotatableBondCount</th>\n",
       "      <th>HeavyAtomCount</th>\n",
       "      <th>AtomStereoCount</th>\n",
       "      <th>...</th>\n",
       "      <th>FeatureCount3D</th>\n",
       "      <th>FeatureAcceptorCount3D</th>\n",
       "      <th>FeatureDonorCount3D</th>\n",
       "      <th>FeatureAnionCount3D</th>\n",
       "      <th>FeatureCationCount3D</th>\n",
       "      <th>FeatureRingCount3D</th>\n",
       "      <th>FeatureHydrophobeCount3D</th>\n",
       "      <th>ConformerModelRMSD3D</th>\n",
       "      <th>EffectiveRotorCount3D</th>\n",
       "      <th>ConformerCount3D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>6322</td>\n",
       "      <td>174.20</td>\n",
       "      <td>-4.2</td>\n",
       "      <td>128.0</td>\n",
       "      <td>176.0</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>12</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>8</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5962</td>\n",
       "      <td>146.19</td>\n",
       "      <td>-3.0</td>\n",
       "      <td>89.3</td>\n",
       "      <td>106.0</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>7</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>5960</td>\n",
       "      <td>133.10</td>\n",
       "      <td>-2.8</td>\n",
       "      <td>101.0</td>\n",
       "      <td>133.0</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>9</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>8</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>3</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>33032</td>\n",
       "      <td>147.13</td>\n",
       "      <td>-3.7</td>\n",
       "      <td>101.0</td>\n",
       "      <td>145.0</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>8</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>4</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5961</td>\n",
       "      <td>146.14</td>\n",
       "      <td>-3.1</td>\n",
       "      <td>106.0</td>\n",
       "      <td>146.0</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>7</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>4</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6267</td>\n",
       "      <td>132.12</td>\n",
       "      <td>-3.4</td>\n",
       "      <td>106.0</td>\n",
       "      <td>134.0</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>9</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>7</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>3</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>6274</td>\n",
       "      <td>155.15</td>\n",
       "      <td>-3.2</td>\n",
       "      <td>92.0</td>\n",
       "      <td>151.0</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>11</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>8</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>3</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>5951</td>\n",
       "      <td>105.09</td>\n",
       "      <td>-3.1</td>\n",
       "      <td>83.6</td>\n",
       "      <td>72.6</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>7</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.4</td>\n",
       "      <td>2</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>6288</td>\n",
       "      <td>119.12</td>\n",
       "      <td>-2.9</td>\n",
       "      <td>83.6</td>\n",
       "      <td>93.3</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>8</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>7</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.4</td>\n",
       "      <td>2</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>5862</td>\n",
       "      <td>121.16</td>\n",
       "      <td>-2.5</td>\n",
       "      <td>64.3</td>\n",
       "      <td>75.3</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.4</td>\n",
       "      <td>2</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>6305</td>\n",
       "      <td>204.22</td>\n",
       "      <td>-1.1</td>\n",
       "      <td>79.1</td>\n",
       "      <td>245.0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>15</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>9</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>3</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>6057</td>\n",
       "      <td>181.19</td>\n",
       "      <td>-2.3</td>\n",
       "      <td>83.6</td>\n",
       "      <td>176.0</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>13</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>7</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>3</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>6137</td>\n",
       "      <td>149.21</td>\n",
       "      <td>-1.9</td>\n",
       "      <td>88.6</td>\n",
       "      <td>97.0</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>9</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>6</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.6</td>\n",
       "      <td>4</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>5950</td>\n",
       "      <td>89.09</td>\n",
       "      <td>-3.0</td>\n",
       "      <td>63.3</td>\n",
       "      <td>61.8</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.4</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>6306</td>\n",
       "      <td>131.17</td>\n",
       "      <td>-1.7</td>\n",
       "      <td>63.3</td>\n",
       "      <td>103.0</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>9</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>7</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0.6</td>\n",
       "      <td>3</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>6106</td>\n",
       "      <td>131.17</td>\n",
       "      <td>-1.5</td>\n",
       "      <td>63.3</td>\n",
       "      <td>101.0</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>9</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>6</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.6</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>6140</td>\n",
       "      <td>165.19</td>\n",
       "      <td>-1.5</td>\n",
       "      <td>63.3</td>\n",
       "      <td>153.0</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>12</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>6</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>3</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>6287</td>\n",
       "      <td>117.15</td>\n",
       "      <td>-2.3</td>\n",
       "      <td>63.3</td>\n",
       "      <td>90.4</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>6</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.4</td>\n",
       "      <td>2</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>614</td>\n",
       "      <td>115.13</td>\n",
       "      <td>-2.5</td>\n",
       "      <td>49.3</td>\n",
       "      <td>103.0</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>6</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0.4</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>750</td>\n",
       "      <td>75.07</td>\n",
       "      <td>-3.2</td>\n",
       "      <td>63.3</td>\n",
       "      <td>42.9</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.4</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>20 rows × 25 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      CID  MolecularWeight  XLogP   TPSA  Complexity  HBondDonorCount  \\\n",
       "0    6322           174.20   -4.2  128.0       176.0                4   \n",
       "1    5962           146.19   -3.0   89.3       106.0                3   \n",
       "2    5960           133.10   -2.8  101.0       133.0                3   \n",
       "3   33032           147.13   -3.7  101.0       145.0                3   \n",
       "4    5961           146.14   -3.1  106.0       146.0                3   \n",
       "5    6267           132.12   -3.4  106.0       134.0                3   \n",
       "6    6274           155.15   -3.2   92.0       151.0                3   \n",
       "7    5951           105.09   -3.1   83.6        72.6                3   \n",
       "8    6288           119.12   -2.9   83.6        93.3                3   \n",
       "9    5862           121.16   -2.5   64.3        75.3                3   \n",
       "10   6305           204.22   -1.1   79.1       245.0                3   \n",
       "11   6057           181.19   -2.3   83.6       176.0                3   \n",
       "12   6137           149.21   -1.9   88.6        97.0                2   \n",
       "13   5950            89.09   -3.0   63.3        61.8                2   \n",
       "14   6306           131.17   -1.7   63.3       103.0                2   \n",
       "15   6106           131.17   -1.5   63.3       101.0                2   \n",
       "16   6140           165.19   -1.5   63.3       153.0                2   \n",
       "17   6287           117.15   -2.3   63.3        90.4                2   \n",
       "18    614           115.13   -2.5   49.3       103.0                2   \n",
       "19    750            75.07   -3.2   63.3        42.9                2   \n",
       "\n",
       "    HBondAcceptorCount  RotatableBondCount  HeavyAtomCount  AtomStereoCount  \\\n",
       "0                    4                   5              12                1   \n",
       "1                    4                   5              10                1   \n",
       "2                    5                   3               9                1   \n",
       "3                    5                   4              10                1   \n",
       "4                    4                   4              10                1   \n",
       "5                    4                   3               9                1   \n",
       "6                    4                   3              11                1   \n",
       "7                    4                   2               7                1   \n",
       "8                    4                   2               8                2   \n",
       "9                    4                   2               7                1   \n",
       "10                   3                   3              15                1   \n",
       "11                   4                   3              13                1   \n",
       "12                   4                   4               9                1   \n",
       "13                   3                   1               6                1   \n",
       "14                   3                   3               9                2   \n",
       "15                   3                   3               9                1   \n",
       "16                   3                   3              12                1   \n",
       "17                   3                   2               8                1   \n",
       "18                   3                   1               8                1   \n",
       "19                   3                   1               5                0   \n",
       "\n",
       "    ...  FeatureCount3D  FeatureAcceptorCount3D  FeatureDonorCount3D  \\\n",
       "0   ...               8                       2                    3   \n",
       "1   ...               7                       2                    2   \n",
       "2   ...               8                       4                    1   \n",
       "3   ...               8                       4                    1   \n",
       "4   ...               7                       3                    2   \n",
       "5   ...               7                       3                    2   \n",
       "6   ...               8                       2                    2   \n",
       "7   ...               7                       3                    2   \n",
       "8   ...               7                       3                    2   \n",
       "9   ...               5                       2                    1   \n",
       "10  ...               9                       2                    2   \n",
       "11  ...               7                       2                    2   \n",
       "12  ...               6                       2                    1   \n",
       "13  ...               5                       2                    1   \n",
       "14  ...               7                       2                    1   \n",
       "15  ...               6                       2                    1   \n",
       "16  ...               6                       2                    1   \n",
       "17  ...               6                       2                    1   \n",
       "18  ...               6                       2                    1   \n",
       "19  ...               5                       2                    1   \n",
       "\n",
       "    FeatureAnionCount3D  FeatureCationCount3D  FeatureRingCount3D  \\\n",
       "0                     1                     2                   0   \n",
       "1                     1                     2                   0   \n",
       "2                     2                     1                   0   \n",
       "3                     2                     1                   0   \n",
       "4                     1                     1                   0   \n",
       "5                     1                     1                   0   \n",
       "6                     1                     2                   1   \n",
       "7                     1                     1                   0   \n",
       "8                     1                     1                   0   \n",
       "9                     1                     1                   0   \n",
       "10                    1                     2                   2   \n",
       "11                    1                     1                   1   \n",
       "12                    1                     1                   0   \n",
       "13                    1                     1                   0   \n",
       "14                    1                     1                   0   \n",
       "15                    1                     1                   0   \n",
       "16                    1                     1                   1   \n",
       "17                    1                     1                   0   \n",
       "18                    1                     1                   1   \n",
       "19                    1                     1                   0   \n",
       "\n",
       "    FeatureHydrophobeCount3D  ConformerModelRMSD3D  EffectiveRotorCount3D  \\\n",
       "0                          0                   0.6                      5   \n",
       "1                          0                   0.6                      5   \n",
       "2                          0                   0.6                      3   \n",
       "3                          0                   0.6                      4   \n",
       "4                          0                   0.6                      4   \n",
       "5                          0                   0.6                      3   \n",
       "6                          0                   0.6                      3   \n",
       "7                          0                   0.4                      2   \n",
       "8                          0                   0.4                      2   \n",
       "9                          0                   0.4                      2   \n",
       "10                         0                   0.6                      3   \n",
       "11                         0                   0.6                      3   \n",
       "12                         1                   0.6                      4   \n",
       "13                         0                   0.4                      1   \n",
       "14                         2                   0.6                      3   \n",
       "15                         1                   0.6                      3   \n",
       "16                         0                   0.6                      3   \n",
       "17                         1                   0.4                      2   \n",
       "18                         0                   0.4                      2   \n",
       "19                         0                   0.4                      1   \n",
       "\n",
       "    ConformerCount3D  \n",
       "0                 10  \n",
       "1                 10  \n",
       "2                 10  \n",
       "3                 10  \n",
       "4                 10  \n",
       "5                 10  \n",
       "6                 10  \n",
       "7                  9  \n",
       "8                  9  \n",
       "9                  9  \n",
       "10                10  \n",
       "11                10  \n",
       "12                10  \n",
       "13                 3  \n",
       "14                10  \n",
       "15                 3  \n",
       "16                10  \n",
       "17                 8  \n",
       "18                 4  \n",
       "19                 2  \n",
       "\n",
       "[20 rows x 25 columns]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "csv_data = pd.read_csv('test_data.csv')\n",
    "df = pd.DataFrame(csv_data)\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "285aa712-34ad-4365-b559-b6aa449df835",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "positional argument follows keyword argument (Temp/ipykernel_9028/507689300.py, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  File \u001b[1;32m\"C:\\Users\\bruce\\AppData\\Local\\Temp/ipykernel_9028/507689300.py\"\u001b[1;36m, line \u001b[1;32m1\u001b[0m\n\u001b[1;33m    series = pd.Series(name='name',['R','K','D','E','Q','N','H','S','T','C','W','Y','M','A','I','L','F','V','P','G'])\u001b[0m\n\u001b[1;37m                                                                                                                    ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m positional argument follows keyword argument\n"
     ]
    }
   ],
   "source": [
    "series = pd.Series(name='name',['R','K','D','E','Q','N','H','S','T','C','W','Y','M','A','I','L','F','V','P','G'])\n",
    "print(series)\n",
    "# allocate = pd.merge(series,df,left_index=True)\n",
    "# allocate"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4c254832-1a57-4ede-a582-5d83c864a326",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
